This is Enum
public enum PostType
{
Article,
Blog,
};
I am trying to write code but through Exception. The code is here.
string _type = "article";
switch (_type.ToLower())
{
case PostType.Article.ToString().ToLower():
{
query = String.Format(@"Up date article");
break;
}
case PostType.Blog.ToString().ToLower():
{
query = String.Format("UP date blog");
break;
}
default: break;
}
Please help me.
Ravi Vishwakarma
29-Mar-2023Here is program.